//
//  NavigationTest.swift
//  SwiftUIDemo
//
//  Created by 陈旺 on 2022/2/14.
//

import SwiftUI

struct NavigationTest: View {
    var body: some View {
        NavigationView.init(content: {
            List(0..<20) { item in
                NavigationLink(
                    destination: {
                        Text("test")
                    }, label: {
                        Text("index: \(item)")
                    })
            }
            .navigationTitle(
                Text("我是标题")
                    .foregroundColor(Color.purple)
            )
            .navigationBarTitleDisplayMode(NavigationBarItem.TitleDisplayMode.inline)
        })
    }
}

struct NavigationTest_Previews: PreviewProvider {
    static var previews: some View {
        NavigationTest()
            .previewDevice("iPhone 11")
    }
}
